package com.example.cstr.service.serviceImpl;

import com.example.cstr.entity.File;
import com.example.cstr.entity.Message;
import com.example.cstr.entity.StudyContain;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.example.cstr.mapper.ExchangeRulesMapper;
import com.example.cstr.entity.ExchangeRules;
import com.example.cstr.service.ExchangeRulesService;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Service
public class ExchangeRulesServiceImpl implements ExchangeRulesService {

    @Resource
    private ExchangeRulesMapper exchangeRulesMapper;

    @Override
    public int deleteByPrimaryKey(Integer erId) {
        return exchangeRulesMapper.deleteByPrimaryKey(erId);
    }

    @Override
    public int insert(ExchangeRules record) {
        return exchangeRulesMapper.insert(record);
    }

    @Override
    public int insertSelective(ExchangeRules record) {
        return exchangeRulesMapper.insertSelective(record);
    }

    @Override
    public ExchangeRules selectByPrimaryKey(Integer erId) {
        return exchangeRulesMapper.selectByPrimaryKey(erId);
    }

    @Override
    public int updateByPrimaryKeySelective(ExchangeRules record) {
        return exchangeRulesMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(ExchangeRules record) {
        return exchangeRulesMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<ExchangeRules> selectAllExchangeRules() {
        return exchangeRulesMapper.selectAllExchangeRules();
    }

    @Override
    public Message PagingSearch(@RequestParam Integer pageNum, @RequestParam Integer size) {
        PageHelper.startPage(pageNum, size);
        List<ExchangeRules> exchangeRulesList = exchangeRulesMapper.selectAllExchangeRules();
        PageInfo pageInfo = new PageInfo(exchangeRulesList);
        pageInfo.getTotal();
        return Message.success(null).add(pageInfo);
    }

    @Override
    public List<ExchangeRules> selectByEr_etp_id(Integer er_etp_id) {
        return exchangeRulesMapper.selectByEr_etp_id(er_etp_id);
    }
}









